package com.ehotting.mqbd.core.mq.batch;

import com.ehotting.mqbd.api.bean.MQDataAble;
import com.ehotting.mqbd.api.bean.MqApplicationContext;
import com.ehotting.mqbd.api.enums.DirectionEnum;
import com.ehotting.mqbd.api.enums.TopicEnum;
import com.ehotting.mqbd.core.logger.MqMsgLogger;
import com.ehotting.mqbd.core.mq.consumer.action.ConsumerResponseAction;
import com.ehotting.mqbd.core.manager.ModuleManager;
import com.ehotting.mqbd.core.sync.MqSyncFutureMapHelper;

import java.util.ArrayList;
import java.util.List;

public  class BatchConsumerResponseAction {

    private List<ConsumerResponseAction> list = new ArrayList<>();

    public BatchConsumerResponseAction(MqSyncFutureMapHelper<MQDataAble> mqSyncFutureMapHelper,
                                       BatchMqApplicationContext batchMqApplicationContext,
                                       TopicEnum topic,
                                       DirectionEnum direction,
                                       ModuleManager moduleManager, MqMsgLogger mqMsgLogger){
        for(MqApplicationContext mqApplicationContext : batchMqApplicationContext.getMqApplicationContextList()){
            ConsumerResponseAction consumerResponse = new ConsumerResponseAction(
                    mqSyncFutureMapHelper,
                    mqApplicationContext,
                    topic,
                    direction,
                    moduleManager,mqMsgLogger);
            list.add(consumerResponse);
        }
    }


    //public abstract void extInvoke(MQDataAble data) ;

    public List<ConsumerResponseAction> getList() {
        return list;
    }
}
